using System;
using System.Data;
using System.Data.SqlClient;

using Wicresoft.Common;

namespace Wicresoft.Busi
{
	public class ProcedureAccess
	{

		public static DataSet Goverment (DateTime StartDate, DateTime EndDate)
		{
			SqlParameter [] paras = new SqlParameter[2];
			#region Prepare parameters
			paras[0] = new SqlParameter("@StartDate", SqlDbType.DateTime);
			paras[0].Value = ObjectType.DateTimeTypeHelper.Set(StartDate);
			paras[1] = new SqlParameter("@EndDate", SqlDbType.DateTime);
			paras[1].Value = ObjectType.DateTimeTypeHelper.Set(EndDate);
			#endregion

			return DataAccess.ExecuteProcedure("Busi.ConnectionString", "Goverment", paras);			
		}

		public static DataSet spGetTransferByUserExceptDocumentExt (string __UserName, string __InfoType, string __WhereClause, string __SortField, int __StartPage, int __PageSize, bool __IsAsc, int __Count)
		{
			SqlParameter [] paras = new SqlParameter[8];
			#region Prepare parameters
			paras[0] = new SqlParameter("@__UserName", SqlDbType.NVarChar, 50);
			paras[0].Value = ObjectType.StringTypeHelper.Set(__UserName);
			paras[1] = new SqlParameter("@__InfoType", SqlDbType.NVarChar, 20);
			paras[1].Value = ObjectType.StringTypeHelper.Set(__InfoType);
			paras[2] = new SqlParameter("@__WhereClause", SqlDbType.NVarChar, 1000);
			paras[2].Value = ObjectType.StringTypeHelper.Set(__WhereClause);
			paras[3] = new SqlParameter("@__SortField", SqlDbType.NVarChar, 255);
			paras[3].Value = ObjectType.StringTypeHelper.Set(__SortField);
			paras[4] = new SqlParameter("@__StartPage", SqlDbType.Int);
			paras[4].Value = ObjectType.IntTypeHelper.Set(__StartPage);
			paras[5] = new SqlParameter("@__PageSize", SqlDbType.Int);
			paras[5].Value = ObjectType.IntTypeHelper.Set(__PageSize);
			paras[6] = new SqlParameter("@__IsAsc", SqlDbType.Bit);
			paras[6].Value = ObjectType.BooleanTypeHelper.Set(__IsAsc);
			paras[7] = new SqlParameter("@__Count", SqlDbType.Int);
			paras[7].Value = ObjectType.IntTypeHelper.Set(__Count);
			#endregion

			return DataAccess.ExecuteProcedure("Busi.ConnectionString", "spGetTransferByUserExceptDocumentExt", paras);			
		}
	}
}